import { defineStore } from 'pinia'

export type FingerType = 'click' | 'left-slide' | 'right-slide' | 'top-slide' | 'top-slide_1'

export const useFinger = defineStore('finger', {
  state: () => ({
    fingerX: 0,
    fingerY: 0,
    size: 40,
    type: 'click' as FingerType,
    isReverse: false,
  }),
  getters: {
    isShowFinger: state => state.fingerX && state.fingerY,
  },
  actions: {
    hideFinger() {
      this.fingerX = 0
      this.fingerY = 0
      this.type = 'click'
      this.isReverse = false
    },
  },
})
